package com.jse.tpl;

import java.lang.reflect.InvocationTargetException;

public class TemplateEngineFactory
{
	// public static String ENGINE = "com.jse.tpl.DefaultTemplateEngine";

	/**
	 * 也可以使用com.jse.tpl.DefaultTemplateEngine
	 */
	public static String ENGINE = "com.jse.tpl.FastRuntimeEngine";

	public static TemplateEngine getEngine(String engine)
	{
		
			try {
				return (TemplateEngine) Class.forName(engine).getConstructor().newInstance();
			} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
					| InvocationTargetException | NoSuchMethodException | SecurityException
					| ClassNotFoundException e) {
				e.printStackTrace();
				throw new RuntimeException(e.getMessage());
			}
		

	}
}
